<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <title>倒计时器</title>
  <style>
    body {
      font-family: sans-serif;
      background-color: #f0f4f8;
      text-align: center;
      padding-top: 100px;
    }
    #countdown {
      font-size: 36px;
      margin-top: 20px;
    }
  </style>
</head>
<body>
  <h1>🎯 倒计时至 2025 年 12 月 31 日</h1>
  <div id="countdown">加载中...</div>

  <script>
    const targetDate = new Date("2025-12-31T00:00:00");

    function updateCountdown() {
      const now = new Date();
      const diff = targetDate - now;

      if (diff <= 0) {
        document.getElementById("countdown").innerText = "🎉 时间到！";
        clearInterval(timer);
        return;
      }

      const days = Math.floor(diff / (1000 * 60 * 60 * 24));
      const hours = Math.floor((diff / (1000 * 60 * 60)) % 24);
      const minutes = Math.floor((diff / (1000 * 60)) % 60);
      const seconds = Math.floor((diff / 1000) % 60);

      document.getElementById("countdown").innerText = 
        `${days}天 ${hours}小时 ${minutes}分 ${seconds}秒`;
    }

    const timer = setInterval(updateCountdown, 1000);
    updateCountdown();
  </script>
</body>
</html>
